<script setup>
defineProps({
  avatar: String,
  username: String,
  nickname: String,
  status: String,
  id: Number,
  total_amount: Number,
  role: {
    type: String,
    default: ''
  }
})
</script>

<template>
  <div class="user-info">
    <van-image width="30" height="30" fit="cover" :src="avatar" />
    <div class="username">
      <van-text-ellipsis :rows="1" :content="nickname" class="nickname"></van-text-ellipsis>
      <van-text-ellipsis :rows="1" :content="'价值：' + total_amount" class="nickname" style="color: red;"></van-text-ellipsis>
      <p>{{ username }} {{ id }} {{ role }}</p>
    </div>
    <!-- <div class="zhuantau" :class="'zhuantau_' + status">{{ status == 5 ? '交易关闭' : status == 3 ? '待收货' : status == 2 ? '待发货' :
      status == 1 ? '待支付' : '交易完成' }}</div> -->
  </div>
</template>

<style scoped lang="less">
.user-info {
  flex: 1;
  display: flex;
  align-items: center;

  .username {
    flex: 0.8;
    font-size: 12px;
    margin-left: 10px;

    .nickname {
      /* min-width: 90px; */
      max-width: 120px;
    }

    p:last-child {
      font-size: 14px;
    }
  }
.zhuantau{
 &.zhuantau_1 {
    color: #67C23A;
  }

  &.zhuantau_2 {
    color: #E6A23C;
  }

  &.zhuantau_3 {
    color: #F56C6C;
  }

  &.zhuantau_4 {
    color: #909399;
  }

  &.zhuantau_5 {
    color: #409EFF;
  } 
}
  
}
</style>